﻿   
using iMES.Entity.SystemModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace iMES.Entity.DomainModels
{


    [Entity(TableCnName = "生产工单", TableName = "Productionorder_WorkOrder")]
    public partial class Productionorder_WorkOrder:SysEntity
    {
        [Key]
        [Display(Name = "生产工单主键")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int Id { get; set; }

        /// <summary>
        /// 工单名称，如 SCDH20250606014121351381
        /// </summary>
        [Display(Name = "工单名称")]
        [MaxLength(50)]
        [Column(TypeName = "varchar(50)")]
        [Editable(true)]
 
        public string WorkOrderName { get; set; }
        /// <summary>
        /// 关联生产单号（关联 ProductionOrder 的 OrderNo）
        /// </summary> 
        [Display(Name = "关联生产单号")]
        [MaxLength(50)]
        [Column(TypeName = "varchar(50)")]
        [Editable(true)]
        public string RelatedProductionOrderNo { get; set; }
        /// <summary>
        /// 工单编号（手动输入）
        /// </summary>  
        [Display(Name = "工单编号")]
        [MaxLength(50)]
        [Column(TypeName = "varchar(50)")]
        [Editable(true)]
        public string WorkOrderCode { get; set; }
        /// <summary>
        /// 销售订单（选填）
        /// </summary> 
        [Display(Name = "销售订单")]
        [MaxLength(50)]
        [Column(TypeName = "varchar(50)")]
        [Editable(true)]
        public string SalesOrder { get; set; }
        /// <summary>
        /// 工单日期
        /// </summary> 
        [Display(Name = "工单日期")]
        [MaxLength(50)]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime WorkOrderDate { get; set; }
        /// <summary>
        /// 所属部门
        /// </summary> 
        [Display(Name = "所属部门")]
       [MaxLength(50)]
       [Column(TypeName = "varchar(50)")]
       [Editable(true)]
        public string BelongDept { get; set; }
        /// <summary>
        /// 负责人
        /// </summary> 
        [Display(Name = "负责人")]
        [MaxLength(50)]
        [Column(TypeName = "varchar(50)")]
        [Editable(true)]
        public string Principal { get; set; }
        /// <summary>
        /// 联项目
        /// </summary> 
        [Display(Name = "联项目")]
        [MaxLength(50)]
        [Column(TypeName = "varchar(50)")]
        [Editable(true)]
        public string RelatedProject { get; set; }
        /// <summary>
        /// 备注
        /// </summary>  
        [Display(Name = "备注")]
        [MaxLength(50)]
        [Column(TypeName = "varchar(50)")]
        [Editable(true)]
        public string Remark { get; set; }

        // 导航属性：关联的工序（一个工单有多个工序）
        //public List<WorkOrderProcess> Processes { get; set; }
        //// 导航属性：关联的物品（一个工单有多个物品）
        //public List<WorkOrderItem> Items { get; set; }
    }
}
